﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExcelImportErrorList.ascx.cs" Inherits="Analysis.Controls.ExcelImportErrorList" %>

<script type="text/javascript">
    $(function () {
        $("#excelImportErrorDialog").dialog({ autoOpen: false, width: 900, height: 650, resizable: false });
        $("#excelImportErrorDialog").parent().appendTo(jQuery("form:first"));

        $(".ui-dialog-titlebar").hide();

        <%=this.JsCodeToRunOnReady%>;
    });

    function showExcelImportErrorList() {
        $('#excelImportErrorDialog').dialog('open');
    }
</script>

<div id="excelImportErrorDialog">
    <asp:UpdatePanel runat="server" ID="upExcelImportError" OnLoad="upExcelImportError_Load" UpdateMode="Conditional">
    <ContentTemplate>
                    <div class="fieldset_block col-lg-12 page_area">
                        <fieldset>
                            <legend><h4>Ошибки в файле импорта</h4></legend>
                            <div class="fieldset_cotent form-horizontal">
                            <div class="table-responsive" style="overflow-y:auto;height:450px;">
                                <asp:GridView ID="gridExcelImportError" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                                    AllowPaging="False" PageSize="20" OnRowDataBound="gridExcelImportError_RowDataBound" ShowHeader="true">
                                <Columns>
                                    <asp:BoundField HeaderText="Номер строки Excel" DataField="RowNum" />
                                    <asp:BoundField HeaderText="Название поля" DataField="ColumnName" />
                                    <asp:BoundField HeaderText="Сообщение об ошибке" DataField="ErrorMessage" />
                                    <asp:BoundField HeaderText="Значение" DataField="Value" />
                                </Columns>
                                </asp:GridView>
                            </div>

                                <div class="button_group">
                                    <asp:Button CssClass="btn btn-info" ID="btnExcelExport" Text="Экспорт в Excel" runat="server" OnClick="btnExcelExport_Click" />
                                    <asp:Button CssClass="btn btn-info" ID="btnCancel" Text="Закрыть" runat="server" OnClientClick="$('#excelImportErrorDialog').dialog('close'); return false;" />
                                </div>
                            </div>
                        </fieldset>
                    </div>
    </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExcelExport" />
        </Triggers>
    </asp:UpdatePanel>
</div>
